//---------------------------------------------------------------------------------- // Title: COOLjsMenu // URL: http://javascript.cooldev.com/scripts/coolmenu/ // Version: 1.8.8 // Last Modify: 12/02/2002 // Author: Sergey Nosenko // Registered version // Copyright (c) 2001-2002 by CoolDev.Com // Copyright (c) 2001-2002 by Sergey Nosenko //---------------------------------------------------------------------------------- window.CMenus=[]; var BLANK_IMAGE="/images/b.gif"; function bw_check(){var is_major=parseInt(navigator.appVersion);this.nver=is_major;this.ver=navigator.appVersion;this.agent=navigator.userAgent;this.dom=document.getElementById?1:0;this.opera=window.opera?1:0;this.ie5=(this.ver.indexOf("MSIE 5")>-1&&this.dom&&!this.opera)?1:0;this.ie6=(this.ver.indexOf("MSIE 6")>-1&&this.dom&&!this.opera)?1:0;this.ie4=(document.all&&!this.dom&&!this.opera)?1:0;this.ie=this.ie4||this.ie5||this.ie6;this.mac=this.agent.indexOf("Mac")>-1;this.ns6=(this.dom&&parseInt(this.ver)>=5)?1:0;this.ie3=(this.ver.indexOf("MSIE")&&(is_major<4));this.hotjava=(this.agent.toLowerCase().indexOf('hotjava')!=-1)?1:0;this.ns4=(document.layers&&!this.dom&&!this.hotjava)?1:0;this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera);this.ver3=(this.hotjava||this.ie3);this.opera7=((this.agent.toLowerCase().indexOf('opera 7')>-1) || (this.agent.toLowerCase().indexOf('opera/7')>-1));this.operaOld=this.opera&&!this.opera7;return this;}; function nn(val){return val != null;} function und(val){return typeof(val) == 'undefined';} function COOLjsMenu(name, items){ this.REGISTERED=0; this.bw=new bw_check();this.bi=new Image();this.bi.src=BLANK_IMAGE; if (!window.CMenus) window.CMenus=[]; window.CMenus[name]=this; if (!window.CMenuHideTimers) window.CMenuHideTimers=[]; window.CMenuHideTimers[name]=null;this.name=name;this.root=[];this.root.par=null; this.root.cd=[];this.root.fmt=items[0];this.items=[]; this.root.frameoff = items[0].pos?items[0].pos:[0,0]; this.root.lvl=new CMenuLevel(this, this.root); for (var i=1;imt) mt = c[i].pos[1];}var fn=this.root.cd[0];return [parseInt(ml),parseInt(mt+fn.size[0]+fn.style.shadow)];} this.wm_show=function(){if(this.bw.ns4) return; var div = get_div(this.name+'_wm');div.style.visibility='visible';} this.wm_move=function(){if(this.bw.ns4) return; var p = this.wm_get_pos();var div = get_div(this.name+'_wm');if (this.bw.ns4) div.moveTo(p[0],p[1]); else{div.style.left=p[0];div.style.top=p[1];}} this.wm_draw=function(x,y){if(this.bw.ns4) return; var p = this.wm_get_pos();document.write(adiv(this.bw, this.name+'_wm', 0,p[0],p[1] ,30,10,'',unescape(''),'font-size:7px;color:#d0d0d0;visibility:hide',''));} this.draw=function (){ for (var i=0;i 0}; this.div=function(n){return und(this.divs[n])?this.divs[n]=get_div(this.id+n):this.divs[n]}; this.draw=function (){ var b=this.style.border; var s=this.style.shadow; return (!this.style.shadow?"":adiv(this.menu.bw, this.id+"s", parseInt(this.z)+1, this.pos[0]+s, this.pos[1]+s, this.size[1], this.size[0], this.style.color.shadow, "", ""))+ (!this.style.border?"":adiv(this.menu.bw, this.id+"b", parseInt(this.z)+2, this.pos[0], this.pos[1], this.size[1], this.size[0], this.style.color.border, "", ""))+ adiv(this.menu.bw, this.id+"o", parseInt(this.z)+3, this.pos[0]+b, this.pos[1]+b, this.size[1]-b*2, this.size[0]-b*2, this.style.color.bgOVER, '
'+this.ocode+'
', "")+ adiv(this.menu.bw, this.id+"n", parseInt(this.z)+4, this.pos[0]+b, this.pos[1]+b, this.size[1]-b*2, this.size[0]-b*2, this.style.color.bgON, '
'+this.code+'
', "")+ adiv(this.menu.bw, this.id+"e", parseInt(this.z)+5, this.pos[0]+b, this.pos[1]+b, this.size[1]-b*2, this.size[0]-b*2, "", ''+'', "", '' ); } this.vis=function(s){ if (this.style.shadow) this.visDiv("s",s); if (this.style.border) this.visDiv("b",s); if (!s) {this.visDiv("o",0);this.visDiv("n",0);this.state="n";} else if (this.state=="n") this.visDiv("n",1); else this.visDiv("o",1); this.visDiv("e",s); } this.setVis=function (n){ if (this.state!=n) switch (n){ case "n":this.visDiv("n",1);this.visDiv("o",0);break; case "o":this.visDiv("n",0);this.visDiv("o",1);break; } this.state=n; } this.visDiv=this.bw.ns4? visDivNS:visDivDom; this.getf=function(obj, name){ if (!und(obj) && nn(obj) && !und(obj.fmt)) { if (!und(obj.fmt[name])) return obj.fmt[name]; if (obj.par!=this.menu.root && obj.par && obj.par.sub && obj.par.sub[0][name]) return obj.par.sub[0][name]; return this.getf(obj.par, name);} return; } this.ioff=this.getf(this, "itemoff"); this.loff=this.getf(this, "leveloff"); this.style=this.getf(this, "style"); this.size=this.getf(this, "size"); this.prev=this.pindex==0? null : this.par.cd[this.pindex-1]; this.setPos=function(){ if (this.prev==null){ this.z=this.par == this.menu.root? 0: parseInt(this.par.z)+10; this.pos=und(this.fmt.pos)?(this.par == this.menu.root? this.menu.root.fmt.pos : this.pos=[this.par.pos[0]+this.loff[1], this.par.pos[1]+this.loff[0]]):this.fmt.pos; }else{ this.prev.next=this; this.z=this.prev.z; this.pos=[this.prev.pos[0]+this.ioff[1], this.prev.pos[1]+this.ioff[0]]; } } this.setPos(); this.sub=item.sub; if (!und(this.sub) && !und(this.sub.length)&& this.sub.length>0){ this.lvl=new CMenuLevel(menu, this); for (var i=1;i'+code+'\n':'
'+code+'
';} function get_div(name){return new bw_check().ns4?document.layers[name]:document.all?document.all[name]:document.getElementById(name);} function visDivNS(d,s){this.div(d).visibility=s?'show':'hide';} function visDivDom(d,s){this.div(d).style.visibility=s?'visible':'hidden';} function mEvent(m,node_index,e) { if (nn(window.CMenuHideTimers[m])) { window.clearTimeout(window.CMenuHideTimers[m]); window.CMenuHideTimers[m]=null; } switch (e){ case "o": window.CMenus[m].items[node_index].par.lvl.setA(node_index,1); if (window.CMenus[m].onmouseover) window.CMenus[m].onmouseover(window.CMenus[m].items[node_index]); break; case "c": if (window.CMenus[m].items[node_index].hc()) window.CMenus[m].items[node_index].lvl.vis(!window.CMenus[m].items[node_index].lvl.v); else for (var i=0;i